package com.game.clases;

/**
 *
 * @author Sefer Sephirott
 */
public class Computer {
    
    private int myFosforos;
    private int val;
    private int[] badNumbers = {5,8,11,14,17,20};
    private int[] posXY;
    
    public Computer() {
        myFosforos = 0;
        posXY = new int[4];
        posXY[0] = 0;
        posXY[1] = 0;
        posXY[2] = 540;
        posXY[3] = 70;
    }
    
    
    public int[] play(int totalFosforos){
        
        System.out.println("Jugo el Computer!");
        
        if(totalFosforos > 2){
                    
            /* Super Logic goes Here!!!!!*/
            val = totalFosforos - 1;
            
            for (int i = 0; i < 6; i++) {
                if(val == badNumbers[i]){
                    posXY[0] = 1;
                    break;
                }
                else if(totalFosforos == 3){
                    // Coge 1 //fosforosTurnoCPU = 1;
                    posXY[0] = 1;
                }
                else{
                    // Coge 2 //fosforosTurnoCPU = 2;
                    posXY[0] = 2;
                }
            }
            
            posXY[1] = totalFosforos - posXY[0];
            
            posXY[3] += 30;
            
            return posXY;
            /* End of Super Logic */

            //fosforosCPU += fosforosTurnoCPU;
            //totalFosforos -= fosforosTurnoCPU;

            //System.out.println("La CPU saco : " + fosforosTurnoCPU);
            //System.out.println("Forforos restantes : " + totalFosforos);
            //return true;
                    
        }
        
        return null;
    }
    
}
